/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013-2014 jfinal app. jfapp Group.
 */

package app.models.activity;

import com.github.sog.annotation.TableBind;
import com.github.sog.plugin.sqlinxml.SqlKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;

import java.util.List;

/**
 * <p>
 * The table olb_brand_like mapping model.
 * </p>
 */
@TableBind(tableName = "ol_brand_activity_like")
public class BrandActivityLike extends Model<BrandActivityLike> {

    private static final long   serialVersionUID = 1L;
    /**
     * The public dao.
     */
    public static final BrandActivityLike dao = new BrandActivityLike();


    public List<BrandActivityLike> list(){
    	return find(SqlKit.sql("brandactivitylike.list"));
    }


    public List<BrandActivityLike> findByMemberId(int mid) {
        List<BrandActivityLike> brandActivityLikes = find(SqlKit.sql("brandactivitylike.findByMemberId"), mid);
        return brandActivityLikes;
    }

    public long countList(long activity) {
        Number number = Db.queryNumber(SqlKit.sql("brandactivitylike.countList"), activity);
        return number == null ? 0L : number.longValue();
    }
}